package pandabay.domain;

import java.util.ArrayList;
import java.util.Date;

/**
 * class to define the attributes and methods of a user
 */
public class User {
	private String forename;
	private String lastname;
	private String email;
	private String password;
	private String street;
	private int plz;
	private String city;
	private int role;
	private int evaluation;
	/*
	 * constructor
	 *
	public User(String forename, String lastname, String email, String password, String street, int plz, String city, int role, int evaluation){
		this.forename = forename;
		this.lastname = lastname;
		this.email = email;
		this.password = password;
		this.street = street;
		this.plz = plz;
		this.city = city;
		this.role = role;
		this.evaluation = evaluation;
	}
	 * 
	 */
	public void newBid(Auction auction, double bid){
		ArrayList<Double> list = auction.getBids();
		list.add(bid);
		auction.setBids(list);
		auction.setHighestBidder(this);
	}
	
	/*
	 * creates a new auction
	 */
	public void createAuction(int id, String name, String description, String image, int evaluation, int category, int startPrice, Date startDate, Date endDate){
		//Product product = new Product(id, name, description, image, evaluation, category);
		//System.out.println("new product has been created: " + product.toString());
		//Auction auction = new Auction(product, this, startPrice, startDate, endDate);
		//System.out.println("new auction has been created: " + auction.toString());
	}
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		return this.forename + " " + this.lastname + " " + this.email + " " + this.password + " " + this.street + " " + this.plz + " "
				+ this.city + " " + this.role + " " + this.evaluation;
	}
	
	//getters and setters

	/*
	 * @return the forename
	 */
	public String getForename() {
		return forename;
	}
	/*
	 * @param forename the forename to set
	 */
	public void setForename(String forename) {
		this.forename = forename;
	}
	/**
	 * @return the lastname
	 */
	public String getLastname() {
		return lastname;
	}
	/**
	 * @param lastname the lastname to set
	 */
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}
	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}
	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}
	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}
	/**
	 * @return the street
	 */
	public String getStreet() {
		return street;
	}
	/**
	 * @param street the street to set
	 */
	public void setStreet(String street) {
		this.street = street;
	}
	/**
	 * @return the plz
	 */
	public int getPlz() {
		return plz;
	}
	/**
	 * @param plz the plz to set
	 */
	public void setPlz(int plz) {
		this.plz = plz;
	}
	/**
	 * @return the city
	 */
	public String getCity() {
		return city;
	}
	/**
	 * @param city the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}
	/**
	 * @return the role
	 */
	public int getRole() {
		return role;
	}
	/**
	 * @param role the role to set
	 */
	public void setRole(int role) {
		this.role = role;
	}
	/**
	 * @return the evaluation
	 */
	public int getEvaluation() {
		return evaluation;
	}
	/**
	 * @param evaluation the evaluation to set
	 */
	public void setEvaluation(int evaluation) {
		this.evaluation = evaluation;
	}
}
